home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 June / EnigmA AMIGA RUN 08 (1996)(G.R. Edizioni)(IT)[!][issue 1996-06][EARSAN CD VII].iso / earcd / comm1 / intsdkss.lha / include / netinet / if_ether.h < prev    next >
C/C++ Source or Header  |  1996-04-09  |  3KB  |  97 lines

  1. #ifndef NETINET_IF_ETHER_H
  2. #define NETINET_IF_ETHER_H
  3. /*
  4.  * Copyright (c) 1982, 1986 Regents of the University of California.
  5.  * All rights reserved.
  6.  *
  7.  * Redistribution and use in source and binary forms are permitted
  8.  * provided that the above copyright notice and this paragraph are
  9.  * duplicated in all such forms and that any documentation,
  10.  * advertising materials, and other materials related to such
  11.  * distribution and use acknowledge that the software was developed
  12.  * by the University of California, Berkeley.  The name of the
  13.  * University may not be used to endorse or promote products derived
  14.  * from this software without specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17.  * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  *
  19.  *    @(#)if_ether.h  7.3 (Berkeley) 6/29/88
  20.  */
  21.  
  22. /*
  23.  * Structure of a 10Mb/s Ethernet header.
  24.  */
  25. struct    ether_header {
  26.     u_char    ether_dhost[6];
  27.     u_char    ether_shost[6];
  28.     u_short ether_type;
  29. };
  30.  
  31. #define ETHERTYPE_PUP    0x0200        /* PUP protocol */
  32. #define ETHERTYPE_IP    0x0800        /* IP protocol */
  33. #define ETHERTYPE_ARP    0x0806        /* Addr. resolution protocol */
  34.  
  35. /*
  36.  * The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
  37.  * (type-ETHERTYPE_TRAIL)*512 bytes of data followed
  38.  * by an ETHER type (as given above) and then the (variable-length) header.
  39.  */
  40. #define ETHERTYPE_TRAIL     0x1000        /* Trailer packet */
  41. #define ETHERTYPE_NTRAILER    16
  42.  
  43. #define ETHERMTU    1500
  44. #define ETHERMIN    (60-14)
  45.  
  46. /*
  47.  * Ethernet Address Resolution Protocol.
  48.  *
  49.  * See RFC 826 for protocol description.  Structure below is adapted
  50.  * to resolving internet addresses.  Field names used correspond to
  51.  * RFC 826.
  52.  */
  53. struct    ether_arp {
  54.     struct    arphdr ea_hdr;    /* fixed-size header */
  55.     u_char    arp_sha[6];    /* sender hardware address */
  56.     u_char    arp_spa[4];    /* sender protocol address */
  57.     u_char    arp_tha[6];    /* target hardware address */
  58.     u_char    arp_tpa[4];    /* target protocol address */
  59. };
  60. #define arp_hrd ea_hdr.ar_hrd
  61. #define arp_pro ea_hdr.ar_pro
  62. #define arp_hln ea_hdr.ar_hln
  63. #define arp_pln ea_hdr.ar_pln
  64. #define arp_op    ea_hdr.ar_op
  65.  
  66.  
  67. /*
  68.  * Structure shared between the ethernet driver modules and
  69.  * the address resolution code.  For example, each ec_softc or il_softc
  70.  * begins with this structure.
  71.  */
  72. struct    arpcom {
  73.     struct    ifnet ac_if;        /* network-visible interface */
  74.     u_char    ac_enaddr[6];        /* ethernet hardware address */
  75.     struct in_addr ac_ipaddr;    /* copy of ip address- XXX */
  76. };
  77.  
  78. /*
  79.  * Internet to ethernet address resolution table.
  80.  */
  81. struct    arptab {
  82.     struct    in_addr at_iaddr;    /* internet address */
  83.     u_char    at_enaddr[6];        /* ethernet address */
  84.     u_char    at_timer;        /* minutes since last reference */
  85.     u_char    at_flags;        /* flags */
  86.     struct    mbuf *at_hold;        /* last packet until resolved/timeout */
  87. };
  88.  
  89. #ifdef    KERNEL
  90. #if 0
  91. extern u_char etherbroadcastaddr[6];
  92. struct    arptab *arptnew();
  93. char *ether_sprintf();
  94. #endif
  95. #endif
  96. #endif
  97.